/*
  ExtendedIdle Plugin for Miranda-IM (www.miranda-im.org)
  Copyright 2004-2007 Joe Kucera

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

	
  some code was copied from Miranda's AutoAway module
*/
#ifndef __EXTENDED_IDLE_HEADER
#define __EXTENDED_IDLE_HEADER

#include <windows.h>
#include <stdio.h>
#include "win2k.h"
#include "resource.h"
#include "newpluginapi.h"
#include "m_system.h"
#include "m_idle.h"
#include "m_awaymsg.h"
#include "m_protosvc.h"
#include "m_langpack.h"
#include "m_database.h"
#include "m_clist.h"
#include "m_options.h"


typedef struct tagLASTINPUTINFO 
{
  UINT cbSize;
  DWORD dwTime;
} LASTINPUTINFO, *PLASTINPUTINFO;


extern int g_UnicodeCore;

char *StatusModeToDbSetting(int status,const char *suffix);

BYTE EIGetSettingByte(const char* szSetting, BYTE bDef);
BYTE EIGetStatusSettingByte(const char* szSetting, int nStatus, BYTE bDef);
WORD EIGetSettingWord(const char* szSetting, WORD wDef);
int EIWriteSettingByte(const char* szSetting, BYTE bValue);
int EIWriteSettingWord(const char* szSetting, WORD wValue);

int GetProtocolCaps(const char* szProto, int nCap);

TCHAR* __fastcall EITranslateT(const char* src, const WCHAR* unibuf);
TCHAR* MirandaStatusToStringT(int mirandaStatus);

TCHAR* EIGetStatusSettingStringT(const char* szSetting, int nStatus);
int EIWriteStatusSettingStringT(const char* szSetting, int nStatus, TCHAR* szValue);

size_t __fastcall strlennull(const char *string);
TCHAR* __fastcall strdupT(const TCHAR *string);
TCHAR* __fastcall strcpyT(TCHAR* dest, const TCHAR* src);
char* tchar_to_ansi(const TCHAR* src);

LRESULT SendMessageT(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);

BOOL SetWindowTextT(HWND hWnd, TCHAR* lpString);
TCHAR* GetWindowTextT(HWND hWnd);
BOOL SetDlgItemTextT(HWND hDlg, int nIDDlgItem, TCHAR* lpString);

#endif